<include file="Public:header_new"/>
<div class="usernewout">
	<div class="usncont">
		<!--左侧菜单-->
		<include file="User:left"/>
		<!--左侧菜单-->
		<!--上方导航-->
		<include file="User:nav"/>
		<!--上方导航-->
	  <div class="usnc_right">
	  <div class="nameauth">
		 <if condition="$user['mibao_question'] eq '' || $user['mibao_question'] eq null">
			<h1>{$Think.lang.g_mibao_set} </h1>
		  <else />
			<h1>{$Think.lang.g_mibao_modif} </h1>
	 </if>
		  <div class="rech_top" style="width: 600px;">
			  <div class="rech_box">
				  <div class="rech_bd safe_rech_bd">
					  <ul>
						  <li>
						  <if condition="$user['mibao_question'] eq '' || $user['mibao_question'] eq null">
							  <div class="rechmid" style="width: 600px;">
								  <div class="rechipt_box" style="width: 600px;">
									  <label>{$Think.lang.User_mibaowt}{$Think.lang.sTrade_index_cnmh}</label>
									  <div class="iptbox">
										  <select id="new_mibao_question" class="rechipt" style="width:351px;">
										<option value=""> {$Think.lang.User_xzmbwt} </option>
										<option value="你父亲的姓名"> {$Think.lang.User_father}</option>
										<option value="你母亲的姓名"> {$Think.lang.User_mather}</option>
										<option value="你爱人的姓名"> {$Think.lang.User_love}</option>
										<option value="你的出生日期">{$Think.lang.User_birthday} </option>
										<option value="你父亲的出生日期">{$Think.lang.User_fatherday} </option>
										<option value="你母亲的出生日期">{$Think.lang.User_matherday} </option>
										<option value="你爱人的出生日期">{$Think.lang.User_loveday} </option>
									</select>
									  </div>
								  </div>

								  <div class="rechipt_box">
									  <label>{$Think.lang.User_wtda} :</label>
									  <div class="iptbox">
										  <input type="text" id="new_mibao_answer" class="rechipt" style="text-indent: 5px;"/>
									  </div>
								  </div>

								  <div class="rechipt_box">
										<label>{$Think.lang.g_mibao_guanlian}{$Think.lang.sTrade_index_cnmh}</label>
										<div class="iptbox" style="line-height:38px;font-size:14px;color:#99A6BF">
											<input type="checkbox" id="findpwd_mibao" <if condition="$user['findpwd_mibao']==1">checked="checked"</if> /> {$Think.lang.g_mibao_pwd} 

											&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

											<input type="checkbox" id="findpaypwd_mibao" <if condition="$user['findpaypwd_mibao']==1">checked="checked"</if> /> {$Think.lang.Login_backpwd}
										</div>
								  </div>

								  <div class="rechipt_box">
									  <label>{$Think.lang.g_yx_verify}{$Think.lang.sTrade_index_cnmh}</label>
									  <div class="iptbox">
										  <input type="text" id="email_verify" value="" class="rechipt halfipt" maxlength="6" style="text-indent: 5px;"/>
										  <input type="button" id="regBtn" onclick="EmCode()" value="{$Think.lang.g_yx_rec_verify} " class="yzmbut">
										  <if condition="$user['email'] eq '' || $user['email'] eq null">
											<p class="attention">{$Think.lang.g_pwd_no_bindyx} </p>
										  <else />
											<p class="attention">* {$Think.lang.g_pwd_yx_recode} {$user['email']}</p>
										  </if>
									  </div>
								  </div>

								  <div class="dv_submit">
									<input type="button" id="btn-submit" value="{$Think.lang.User_save}" title="{$Think.lang.User_save} " onclick="Update1()" />
								  </div>
							  </div>
							<else />
							  <div class="rechmid" style="width: 600px;">
								  <div class="rechipt_box">
									  <label>{$Think.lang.User_mibaowt}{$Think.lang.sTrade_index_cnmh}</label>
									  <div class="iptbox">
										  <select id="mibao_question" class="rechipt" style="width:352px;">
										<option value="">{$Think.lang.choose_code_que}</option>
										<option value="你父亲的姓名"> {$Think.lang.User_father}</option>
										<option value="你母亲的姓名"> {$Think.lang.User_mather}</option>
										<option value="你爱人的姓名">{$Think.lang.User_love}</option>
										<option value="你的出生日期">{$Think.lang.User_birthday}</option>
										<option value="你父亲的出生日期">{$Think.lang.User_fatherday}</option>
										<option value="你母亲的出生日期">{$Think.lang.User_matherday}</option>
										<option value="你爱人的出生日期">{$Think.lang.User_loveday} </option>
									</select>
									  </div>
								  </div>

								  <div class="rechipt_box">
									  <label>{$Think.lang.User_wtda}{$Think.lang.sTrade_index_cnmh}</label>
									  <div class="iptbox">
										  <input type="text" id="mibao_answer" class="rechipt" style="text-indent:5px;"/>
									  </div>
								  </div>

								  <div class="rechipt_box">
									  <label>{$Think.lang.User_newmbwt} :</label>
									  <div class="iptbox">
										  <select id="new_mibao_question" class="rechipt" style="width:352px;">
										<option value="">{$Think.lang.choose_code_que} </option>
										<option value="你父亲的姓名">{$Think.lang.User_father} </option>
										<option value="你母亲的姓名">{$Think.lang.User_mather}</option>
										<option value="你爱人的姓名">{$Think.lang.User_love} </option>
										<option value="你的出生日期">{$Think.lang.User_birthday} </option>
										<option value="你父亲的出生日期">{$Think.lang.User_fatherday}</option>
										<option value="你母亲的出生日期">{$Think.lang.User_matherday}</option>
										<option value="你爱人的出生日期">{$Think.lang.User_loveday} </option>
									</select>
									  </div>
								  </div>

								  <div class="rechipt_box">
									  <label>{$Think.lang.Login_newwtda}{$Think.lang.sTrade_index_cnmh}</label>
									  <div class="iptbox">
										  <input type="text" id="new_mibao_answer" class="rechipt" placeholder="{$Think.lang.g_mibao_nn} "  style="text-indent: 5px;"/>
									  </div>
								  </div>

								  <div class="rechipt_box">
										<label>{$Think.lang.g_mibao_guanlian}{$Think.lang.sTrade_index_cnmh}</label>
										<div class="iptbox" style="line-height:38px;font-size:14px;">
											<input type="checkbox" id="findpwd_mibao" <if condition="$user['findpwd_mibao']==1">checked="checked"</if> /> {$Think.lang.g_mibao_pwd} 

											&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

											<input type="checkbox" id="findpaypwd_mibao" <if condition="$user['findpaypwd_mibao']==1">checked="checked"</if> /> {$Think.lang.Login_backpwd} 
										</div>
								  </div>

								  <div class="rechipt_box">
									  <label>{$Think.lang.g_yx_verify}{$Think.lang.sTrade_index_cnmh}</label>
									  <div class="iptbox">
										  <input type="text" id="email_verify" value="" class="rechipt halfipt" maxlength="6"  style="text-indent: 5px;"/>
										  <input type="button" id="regBtn" onclick="EmCode()" value="{$Think.lang.g_yx_rec_verify} " class="yzmbut">
										  <if condition="$user['email'] eq '' || $user['email'] eq null">
											<p class="attention">{$Think.lang.g_pwd_no_bindyx} </p>
										  <else />
											<p class="attention">*{$Think.lang.g_pwd_yx_recode}  {$user['email']}</p>
										  </if>
									  </div>
								  </div>

								  <div class="dv_submit">
									<input type="button" id="btn-submit" value="{$Think.lang.User_save} " title="{$Think.lang.User_save} " onclick="Update()"/>
								  </div>
							  </div>
							</if>
						  </li>
					  </ul>
				  </div>
			  </div>
		  </div>
	  </div>
	</div>
	</div>
</div>
<script type="text/javascript">
  $('input').focus(function(){
    var t=$(this);
    if(t.attr('type')=='text'||t.attr('type')=='password')
      t.css({'box-shadow' : '0px 0px 3px #20212d','border' : '1px solid #20212d','color' : '#99A6BF' });
    if(t.val()==t.attr('placeholder'))
      t.val('');
  });
  $('input').blur(function(){
    var t=$(this);
    if(t.attr('type')=='text'||t.attr('type')=='password')
      t.css({'box-shadow' : 'none','border' : '1px solid #20212d','color' : '#99A6BF' });
    if(t.attr('type')!='password'&&!t.val())
      t.val(t.attr('placeholder'));
  });

function EmCode() {
  layer.load(0, {shade: [0.5,'#8F8F8F']});
    $('#regBtn').attr("disabled", "disabled");
    $.post("{:U('Verify/mibaoemail')}", {}, function (data) {
    layer.closeAll();
      if (data.status == 1) {
        layer.msg(data.info, {
          icon: 1
        });
        var obj = $('#regBtn');
        var wait = 120;
        var interval = setInterval(function () {
          obj.css('backgroundColor', '#135f91');
          obj.val(wait + '{$Think.lang.Finance_again} ');
          wait--;
          if (wait < 0) {
            obj.removeAttr("disabled");
            clearInterval(interval);
            obj.val('{$Think.lang.Finance_hqyzm2} ');
            obj.css('backgroundColor', '#135f91');
          }
          ;
        }, 1000);
      } else {
        $('#regBtn').removeAttr("disabled");
        layer.msg(data.info, {
          icon: 2
        });
      }
    }, "json");
}

  function Update(){
    var mibao_question=$("#mibao_question").val();
    var mibao_answer=$("#mibao_answer").val();
    var new_mibao_question=$("#new_mibao_question").val();
    var new_mibao_answer=$("#new_mibao_answer").val();
	if($("#findpwd_mibao").attr("checked") == "checked"){
		var findpwd_mibao = 1;
	}else{
		var findpwd_mibao = 0;
	}
	if($("#findpaypwd_mibao").attr("checked") == "checked"){
		var findpaypwd_mibao = 1;
	}else{
		var findpaypwd_mibao = 0;
	}
	var email_verify = $("#email_verify").val();
    if (email_verify == "" || email_verify == null) {
      layer.tips('{$Think.lang.g_yx_put_verfy} ', '#email_verify', {
        tips: 3
      });
      return false;
    }
    if(mibao_question==""||mibao_question==null){
        layer.tips('{$Think.lang.User_xzmbwt} ','#mibao_question',{tips:3});
        return false;
    }
    if(mibao_answer==""||mibao_answer==null){
        layer.tips('{$Think.lang.input_que_ans} ','#mibao_answer',{tips:3});
        return false;
    }
    $.post("{:U('User/upmibao')}",{email_verify:email_verify,mibao_question : mibao_question,mibao_answer : mibao_answer,new_mibao_question : new_mibao_question,new_mibao_answer:new_mibao_answer,findpwd_mibao:findpwd_mibao,findpaypwd_mibao:findpaypwd_mibao },function(data){
      if(data.status==1){
        layer.msg(data.info,{icon : 1 });
        window.location="{:U('User/mibao')}";
      }else{
        layer.msg(data.info,{icon : 2 });
        if(data.url){
          window.location=data.url;
        }
      }
    },"json");
  }
  function Update1(){
    var mibao_question='';
    var mibao_answer='';
    var new_mibao_question=$("#new_mibao_question").val();
    var new_mibao_answer=$("#new_mibao_answer").val();
	if($("#findpwd_mibao").attr("checked")=="checked"){
		var findpwd_mibao = 1;
	}else{
		var findpwd_mibao = 0;
	}
	if($("#findpaypwd_mibao").attr("checked")=="checked"){
		var findpaypwd_mibao = 1;
	}else{
		var findpaypwd_mibao = 0;
	}
	var email_verify = $("#email_verify").val();
    if (email_verify == "" || email_verify == null) {
      layer.tips('{$Think.lang.g_yx_put_verfy} ', '#email_verify', {
        tips: 3
      });
      return false;
    }
    if(new_mibao_question==""||new_mibao_question==null){
        layer.tips('{$Think.lang.User_xzmbwt} ','#mibao_question',{tips:3});
        return false;
    }
    if(new_mibao_answer==""||new_mibao_answer==null){
        layer.tips('{$Think.lang.input_que_ans} ','#mibao_answer',{tips:3});
        return false;
    }

    $.post("{:U('User/upmibao')}",{email_verify:email_verify, mibao_question : mibao_question,mibao_answer : mibao_answer,new_mibao_question : new_mibao_question,new_mibao_answer:new_mibao_answer,findpwd_mibao:findpwd_mibao,findpaypwd_mibao:findpaypwd_mibao},function(data){
      if(data.status==1){
        layer.msg(data.info,{icon : 1 });
        window.location="{:U('User/mibao')}";
      }else{
        layer.msg(data.info,{icon : 2 });
        if(data.url){
          window.location=data.url;
        }
      }
    },"json");
  }
	$("#mibao_answer").focus(function(){
		var mibaoquestion = $("#mibao_question").val();
		if(!mibaoquestion){
			layer.tips('{$Think.lang.choose_code_que} ！','#mibao_question',{tips:3});
		}
	});
	$("#mibao_answer").blur(function(){
		var mibaoanswer = $("#mibao_answer").val();
		if(!mibaoanswer){
			layer.tips('{$Think.lang.User_xzmbda} ','#mibao_answer',{tips:3});
		}
	});
	$("#new_mibao_answer").focus(function(){
		var mibaoquestion = $("#new_mibao_question").val();
		if(!mibaoquestion){
			layer.tips('{$Think.lang.choose_code_que} ','#new_mibao_question',{tips:3});
		}
	});
	$("#new_mibao_answer").blur(function(){
		var mibaoanswer = $("#new_mibao_answer").val();
		if(!mibaoanswer){
			layer.tips('{$Think.lang.User_xzmbda} ','#new_mibao_answer',{tips:3});
		}
	});
	$("#mobile_verify").blur(function(){
		var mobileverify = $("#mobile_verify").val();
		if(!mobileverify){
			layer.tips('{$Think.lang.User_txdxyzm} ','#mobile_verify',{tips:3});
		}
	});
	$("#findpwd_mibao").click(function(){
		if($(this).attr("checked")=="checked"){
			$(this).attr("checked",false);
		}else{
			$(this).attr("checked","checked");
		}
	});
	$("#findpaypwd_mibao").click(function(){
		if($(this).attr("checked")=="checked"){
			$(this).attr("checked",false);
		}else{
			$(this).attr("checked","checked");
		}
	});
	//菜单高亮
$('#user_index').addClass('on');
</script>
<include file="Public:footer_new"/>